package com.dji.model;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * 表示无人机飞行任务的模型类
 */
public class Mission {
    private String id;
    private String name;
    private String droneId;
    private List<Waypoint> waypoints;
    private String status; // PLANNED, EXECUTING, COMPLETED, ABORTED
    private long createdTime;
    
    public Mission() {
        this.id = UUID.randomUUID().toString();
        this.waypoints = new ArrayList<>();
        this.status = "PLANNED";
        this.createdTime = System.currentTimeMillis();
    }
    
    public Mission(String name, String droneId) {
        this();
        this.name = name;
        this.droneId = droneId;
    }
    
    public void addWaypoint(Waypoint waypoint) {
        this.waypoints.add(waypoint);
    }
    
    // Getters and Setters
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDroneId() {
        return droneId;
    }

    public void setDroneId(String droneId) {
        this.droneId = droneId;
    }

    public List<Waypoint> getWaypoints() {
        return waypoints;
    }

    public void setWaypoints(List<Waypoint> waypoints) {
        this.waypoints = waypoints;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public long getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(long createdTime) {
        this.createdTime = createdTime;
    }
}